package jt.classic.app.info.impl;

import jt.classic.app.info.AInfo;
import jt.classic.app.info.AInfoDirectory;
import jt.classic.app.info.AInfoIssue;

import jt.classic.system.user.IUser;

import org.limp.basework.AbstractSimpleBean;

import java.util.List;
import java.util.Map;


public class AInfoImpl extends AbstractSimpleBean implements AInfo {
    private String id;
    private String title;
    private String provide;
    private String titlefont;
    private String titlesize;
    private String titlecolor;
    private String date;
    private AInfoDirectory direc;
    private AInfoDirectory subject;
    private String typeid;
    private String type;
    private IUser user;
    private int receipt;
    private int doc;
    private Object content;
    private AInfoIssue issue;
    private List annexs;
    private int top;
    private String summary;
    private int involvementCount;
    private int viewCount;
    private int replyCount;

    public Object icontent() {
        // TODO Auto-generated method stub
        return this.content;
    }

    public String id() {
        // TODO Auto-generated method stub
        return this.id;
    }

    public String idate() {
        // TODO Auto-generated method stub
        return this.date;
    }

    public AInfoDirectory idirectory() {
        // TODO Auto-generated method stub
        return this.direc;
    }

    public AInfoDirectory isubject() {
        // TODO Auto-generated method stub
        return this.subject;
    }

    public boolean idoc() {
        // TODO Auto-generated method stub
        return this.doc == 1;
    }

    public boolean ireceipt() {
        // TODO Auto-generated method stub
        return this.receipt == 1;
    }

    public String ititle() {
        // TODO Auto-generated method stub
        return this.title;
    }

    public String ititlefont() {
        return this.titlefont;
    }

    public String ititlesize() {
        return this.titlesize;
    }

    public String ititlecolor() {
        return this.titlecolor;
    }

    public String itype() {
        // TODO Auto-generated method stub
        return this.type;
    }

    public String itypeid() {
        // TODO Auto-generated method stub
        return this.typeid;
    }

    public IUser iuser() {
        // TODO Auto-generated method stub
        return this.user;
    }

    public AInfoIssue issue() {
        return this.issue;
    }

    public List iannexs() {
        return annexs;
    }

    public int itop() {
        return this.top;
    }

    public String isummary() {
        return this.summary;
    }

    public int involvementCount() {
        return this.involvementCount;
    }

    public int iviewCount() {
        return this.viewCount;
    }

    public int ireplyCount() {
        return this.replyCount;
    }
    
    public String iprovide(){
    	return this.provide;
    }

    public void reload(Map info) {
        if (info != null) {
            this.info = info;
            this.id = (String) info.get("IF_ID");
            this.title = (String) info.get("IF_TITLE");
            this.titlecolor = (String) info.get("IF_COLOR");
            this.titlefont = (String) info.get("IF_FONT");
            this.titlesize = (String) info.get("IF_SIZE");
            this.typeid = (String) info.get("IT_ID");
            this.type = (String) info.get("IT_NAME");
            this.receipt = Integer.parseInt((String) info.get("IF_RECEIPT"));

            //this.doc = Integer.parseInt((String) info.get("IF_DOC"));
            this.direc = (AInfoDirectory) info.get("DIRECTORY");
            this.subject = (AInfoDirectory) info.get("SUBJECT");
            this.date = (String) info.get("IF_DATE");
            this.user = (IUser) info.get("USER");
            this.content = info.get("IF_CONTENT");
            this.issue = (AInfoIssue) info.get("ISSUE");
            this.annexs = (List) info.get("ANNEXS");

            this.top = Integer.parseInt((String) info.get("IF_TOP"));
            this.summary = (String) info.get("IF_SUMMARY");
            this.provide = (String) info.get("IF_PROVIDE");
            
            this.involvementCount = Integer.parseInt((String) info.get("IF_IVCOUNT"));
            this.replyCount = Integer.parseInt((String) info.get("IF_RECOUNT"));
            this.viewCount = Integer.parseInt((String) info.get("IF_VECOUNT"));
        }
    }
}
